home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 18
/
CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso
/
CUCD
/
Programming
/
AmigaE
/
Src
/
Class
/
Stack
/
stackuse.e
< prev
Wrap
Text File
|
1992-09-02
|
302b
|
14 lines
-> lets use a STACK!
MODULE 'class/stack'
PROC main() HANDLE
DEF s=NIL:PTR TO stack,a
NEW s.stack() -> amaaazing! :-)
FOR a:=1 TO 10 DO s.push(a)
FOR a:=1 TO 11 DO WriteF('element = \d\n',s.pop())
EXCEPT DO
END s
IF exception="estk" THEN WriteF('You underflowed the stack!\n')
ENDPROC